package com.smart.tool.extension;

import java.util.List;

/**
 *
 *
 * example:
 * @Resource
 *private IExtensionFinder iExtensionFinder;
 * SenceParam senceParam = SenseParam.of(SenceEnum.TEST, "test");
 * Object object = iExtensionFinder.getExtension(senceParam);
 * Test test = iExtensionFinder.getExtension(senceParam, Test.class);
 *
 * List<Test> testList = iExtensionFinder.getSenceExtensionList(senceParam, Test.class);
 *
 *
 */
public interface IExtensionFinder {

    /**
     * 获取场景实现类
     * @param clazz
     * @return
     * @param <T>
     */
   <T> List<T> getSenceExtensionList(Class<T> clazz);

    Object getExtension(SenceParam senceParam);

    /**
     * 获取扩展点
     *
     * @param senceParam
     * @param clazz 目标类
     * @return
     */
    <T> T getExtension(SenceParam senceParam, Class<T> clazz);

    /**
     * 获取场景实现类
     *
     * @param senceParam
     * @param clazz 目标类
     * @return
     */
    <T> List<T> getSenceExtensionList(SenceParam senceParam, Class<T> clazz);
}
